<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xml:lang="en">
<head>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>ShoppingBook </title>

    <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
    <!--[if IE 6]><link rel="stylesheet" href="style.ie6.css" type="text/css" media="screen" /><![endif]-->
    <!--[if IE 7]><link rel="stylesheet" href="style.ie7.css" type="text/css" media="screen" /><![endif]-->

    <script type="text/javascript" src="script.js"></script>
</head>
<body>

<?php 
	session_start() ;
?>

<?php
	include ('includes/configuration.php');
	include ('includes/database.php');
	
	$obj_config = new Config();
	
	if(isset($_SESSION["LoaiUser"]))
	{
		$LoaiUser = $_SESSION["LoaiUser"];
		switch ($LoaiUser)
		{
			case 0:
				echo "<meta http-equiv='refresh' content='0;url=../admin/index.php' />";
				break;
			case 1:
				echo "<meta http-equiv='refresh' content='0;url=../nguoiban/index.php' />";
				break;
		}
	}
	
		$user = '';
	if(isset($_SESSION["Username"]))
	{	
		$user=$_SESSION["Username"];
	}
	else
	{
		echo "<meta http-equiv='refresh' content='0;url=../index.php' />";
	}
	
?>

<div id="art-page-background-glare">
        <div id="art-page-background-glare-image"></div>
    </div>
    <div id="art-main">
        <div class="art-sheet">
            <div class="art-sheet-tl"></div>
            <div class="art-sheet-tr"></div>
            <div class="art-sheet-bl"></div>
            <div class="art-sheet-br"></div>
            <div class="art-sheet-tc"></div>
            <div class="art-sheet-bc"></div>
            <div class="art-sheet-cl"></div>
            <div class="art-sheet-cr"></div>
            <div class="art-sheet-cc"></div>
            <div class="art-sheet-body">
                <div class="art-header">
                    <div class="art-header-png"></div>
                    <div class="art-header-jpeg"></div>
                    <div class="art-logo">
                        <h1 id="name-text" class="art-logo-name"><a href="#">shopping<label style="color:#FFF">book</label></a></h1>
                        <div id="slogan-text" class="art-logo-text">CONNECT BUYERS WITH SELLERS</div>
                    </div>
                    
                    
                    
                    <div style="float:right; display: block;
                      position: absolute;
                      left: 743px;
                      top: 105px;
                      width: 250px">
                                            <div class="art-blockheader">
                                                <div class="l"></div>
                                                <div class="r"></div>
                                                 <div class="t">TÀI KHOẢN NGƯỜI MUA</div>
                                            </div>
                                            <div class="art-blockcontent">
                                                <div class="art-blockcontent-tl"></div>
                                                <div class="art-blockcontent-tr"></div>
                                                <div class="art-blockcontent-bl"></div>
                                                <div class="art-blockcontent-br"></div>
                                                <div class="art-blockcontent-tc"></div>
                                                <div class="art-blockcontent-bc"></div>
                                                <div class="art-blockcontent-cl"></div>
                                                <div class="art-blockcontent-cr"></div>
                                                <div class="art-blockcontent-cc"></div>
                                                <div class="art-blockcontent-body">
                                            <!-- block-content -->
                                                            <table width="200" border="0">
															  <tr>
																<td rowspan="2"><img src="images/buyer_60.png" width="66" height="60" alt="seller" /></td>
																<td align="left"><?php echo '<a href="#">'.$user.'</a>'; ?></td>
															  </tr>
															  <tr>
																<td align="left"><?php echo '<a href="../logout.php">Đăng Xuất</a>'; ?></td>
															  </tr>
															</table>
                                            <!-- /block-content -->
                                            
                                            		<div class="cleared"></div>
                                                </div>
                                            </div>
                            		<div class="cleared"></div>
                                </div>
                    
                    
                    
                </div>
                <div class="art-nav">
                	<div class="l"></div>
                	<div class="r"></div>
                	<ul class="art-menu">
                		<li>
                			<a href="index.php" class="active"><span class="l"></span><span class="r"></span><span class="t">Trang Chủ</span></a>
                		</li>
                		<li>
                			<a href="#"><span class="l"></span><span class="r"></span><span class="t">Tìm Kiếm</span></a>
                			<ul>
                				<li><a href="index.php?com=sanpham&fun=timkiemcoban">Tìm Kiếm Cơ Bản</a>
                					<!--<ul>
                						<li><a href="#">Menu Subitem 1.1</a></li>
                						<li><a href="#">Menu Subitem 1.2</a></li>
                						<li><a href="#">Menu Subitem 1.3</a></li>
                					</ul>-->
                				</li>
                				<li><a href="index.php?com=sanpham&fun=timkiemnangcao">Tìm Kiếm Nâng Cao</a></li>
                			</ul>
                		</li>
                		<li>
                			<a href="#"><span class="l"></span><span class="r"></span><span class="t">Quản Lý</span></a>
                			<ul>
                				<li><a href="#">Thông tin cá nhân</a>
                					<ul>
                						<li><a href="index.php?com=user&fun=updatethongtin">Thay đổi thông tin</a></li>
                						<li><a href="index.php?com=user&fun=updatepass">Thay đổi Mật Khẩu</a></li>
                						
                					</ul>
                				</li>
                				<li><a href="#">Quản lý đặt hàng</a>
									<ul>
                						<li><a href="#">Danh sách hàng đang đặt</a></li>
                						<li><a href="#">Lịch sử đặt hàng</a></li>
                						
                					</ul>
								</li>
                			</ul>
                		</li>		
                		<li>
                			<a href="#"><span class="l"></span><span class="r"></span><span class="t">About</span></a>
                		</li>
                	</ul>
                </div>
                <div class="art-content-layout">
                    <div class="art-content-layout-row">
                        <div class="art-layout-cell art-sidebar1">
                            
                            <div class="art-vmenublock">
                                <div class="art-vmenublock-tl"></div>
                                <div class="art-vmenublock-tr"></div>
                                <div class="art-vmenublock-bl"></div>
                                <div class="art-vmenublock-br"></div>
                                <div class="art-vmenublock-tc"></div>
                                <div class="art-vmenublock-bc"></div>
                                <div class="art-vmenublock-cl"></div>
                                <div class="art-vmenublock-cr"></div>
                                <div class="art-vmenublock-cc"></div>
                                <div class="art-vmenublock-body">
                                            <div class="art-vmenublockheader">
                                                <div class="l"></div>
                                                <div class="r"></div>
                                                 <div class="t">DANH MỤC SẢN PHẨM</div>
                                            </div>
                                            <div class="art-vmenublockcontent">
                                                <div class="art-vmenublockcontent-body">
                                            <!-- block-content -->

<?php
	include_once ('components/danhmuc/class_danhmuc.php');
	
	
	function HienThiDanhMucCap1()
	{
		$dm = new class_danhmuc();
		$tb = $dm->HienThiDanhMucCap1();
		foreach($tb as $row)
		{
			echo '<li><a href="index.php?com=danhmuc&fun=detail&MaDanhMuc='.$row['MaDanhMuc'].'"><span class="l"></span><span class="r"></span><span class="t">'.$row['TenDanhMuc'].'</span></a>';
			HienThiDanhMucCap2TroLen($row['MaDanhMuc']);
			echo '</li>';
		}
	}
	
	function HienThiDanhMucCap2TroLen($MaDanhMucCha)
	{
		$dm = new class_danhmuc();
		if ($dm->GetNumRowsDanhMucCap2TroLen($MaDanhMucCha) == 0)
		{
			return;
		}
		$tb = $dm->HienThiDanhMucCap2TroLen($MaDanhMucCha);
		echo '<ul>';
		foreach ($tb as $row)
		{
			echo '<li><a href="index.php?com=danhmuc&fun=detail&MaDanhMuc='.$row['MaDanhMuc'].'">'.$row['TenDanhMuc'].'</a>';
			HienThiDanhMucCap2TroLen($row['MaDanhMuc']);
			echo '</li>';
		}
		echo '</ul>';
	}
?> 
     
     <ul class="art-vmenu">                                      
<?php 
	HienThiDanhMucCap1();
?>
	</ul>

                                                            <!--<ul class="art-vmenu">
                                                            	<li>
                                                            		<a href="index.php?i1"><span class="l"></span><span class="r"></span><span class="t">Home</span></a>
                                                            	</li>
                                                            	<li>
                                                            		<a href="index.php?i2"><span class="l"></span><span class="r"></span><span class="t">News</span></a>
                                                            				<ul>
                                                            			<li><a href="index.php?">Top 10</a></li>
                                                            		</ul>
                                                            	</li>
                                                            	<li >
                                                            		<a  href="index.php?i3"><span class="l"></span><span class="r"></span><span class="t">Menu Item</span></a>
                                                            		<ul >
                                                            			<li><a href="index.php?i3s1">Subitem 1</a></li>
                                                            			<li><a href="index.php?i3s2" >Subitem 2</a></li>
                                                            			<li><a href="index.php?i3s3">Subitem 3</a></li>
                                                            		</ul>
                                                            	</li>
                                                            	<li>
                                                            		<a href="index.php?i4"><span class="l"></span><span class="r"></span><span class="t">Video</span></a>
                                                            	</li>
                                                            	<li>
                                                            		<a href="index.php?i5"><span class="l"></span><span class="r"></span><span class="t">Archive</span></a>
                                                            		<ul>
                                                            			<li><a href="index.php?i5s1">2008</a>
                                                            				<ul>
                                                            					<li><a href="index.php?i5s1s1">January</a></li>
                                                            					<li><a href="index.php?i5s1s2">February</a></li>
                                                            					<li><a href="index.php?i5s1s3">March</a></li>
                                                            				</ul>
                                                            			</li>
                                                            			<li><a href="index.php?i5s2">2007</a>
                                                            				<ul>
                                                            					<li><a href="index.php?i5s2s1">January</a></li>
                                                            					<li><a href="index.php?i5s2s2">February</a></li>
                                                            					<li><a href="index.php?i5s2s3">March</a></li>
                                                            				</ul>
                                                            			</li>
                                                            			<li><a href="index.php?i5s3">2006</a>
                                                            				<ul>
                                                            					<li><a href="index.php?i5s3s1">January</a></li>
                                                            					<li><a href="index.php?i5s3s2">February</a></li>
                                                            					<li><a href="index.php?i5s3s3">March</a></li>
                                                            				</ul>
                                                            			</li>
                                                            		</ul>
                                                            	</li>
                                                            	<li>
                                                            		<a href="index.php?i6"><span class="l"></span><span class="r"></span><span class="t">Forum</span></a>
                                                            	</li>
                                                            	<li>
                                                            		<a href="index.php?i7"><span class="l"></span><span class="r"></span><span class="t">About</span></a>
                                                            	</li>
                                                            	<li>
                                                            		<a href="index.php?i8"><span class="l"></span><span class="r"></span><span class="t">Contact</span></a>
                                                            	</li>
                                                            </ul>-->
                                            <!-- /block-content -->
                                            
                                            		<div class="cleared"></div>
                                                </div>
                                            </div>
                            		<div class="cleared"></div>
                                </div>
                            </div>
                        </div>
                        <div class="art-layout-cell art-content">

                            <!-- Nội dung trang -->
<?php
	$str = '';
	if (!isset($_GET['com']) && !isset($_GET['fun']))
	{
		include('components/trangchu/trangchu.php');
	}
	else
	{
		$str= 'components/'.$_GET['com'].'/'.$_GET['fun'].'.php';
		include($str);
	}
?>
                            <!-- /Nội dung trang -->  
                            
                        </div>
                    </div>
                </div>
                <div class="cleared"></div><div class="art-footer">
                    <div class="art-footer-t"></div>
                    <div class="art-footer-l"></div>
                    <div class="art-footer-b"></div>
                    <div class="art-footer-r"></div>
                    <div class="art-footer-body">
                         <a href="#" class="art-rss-tag-icon" title="RSS"></a>
                        <div class="art-footer-text">
                            <p><a href="#">Contact Us</a> | <a href="#">Terms of Use</a> | <a href="#">Trademarks</a>
                                | <a href="#">Privacy Statement</a><br />
                                Copyright &copy; 2011 ShoppingBook. All Rights Reserved.</p>
                        </div>
                		<div class="cleared"></div>
                    </div>
                </div>
        		<div class="cleared"></div>
            </div>
        </div>
        <div class="cleared"></div>
        <p class="art-page-footer"></p>
    </div>
    
</body>
</html>
